Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.1K
Vistas
How to prevent parent div to flex in vertical direction while one of the child item flexes?[ReactJS]

So far I implemented this as below.

This is a div inside a ReactJs component:

                <div className='ChatAreaClass' as={InputMessage} style={{
                    display: "flex",
                    flexDirection: "row",
                    borderTop: "1px dashed #d1dbe4",
                    alignItems: 'end',
                    marginBottom: "5px"
                }}>
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${stickersIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${gifIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${emojiIcon})`}}
                    />

                    <textarea onChange={e => setTextAreaAutosize(e)}
                        className='form-control text-area' 
                        value={chatMessage} placeholder='write here ...'>
                    </textarea>

                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${arrowIcon})`}}
                    />
                </div>

css:

.ChatAreaClass {
    text-align: left;
    border-top: unset !important;
    margin-top: 0px;
}

.text-area {
    margin-left: 5px;
    margin-right: 6px;
    margin-bottom: 4px;
    border-radius: 10px;
    overflow: clip;
    margin-top: 5px;
    resize: none;
    border-color: #2200ff;
    max-height:200px;
    scrollbar-width: none;
}

Output:

enter image description here

Now, facing problem for the chat input text-area.

For a large input text messages, It hides the incoming messages. enter image description here

Expected Output is:

enter image description here

How can I achieve this? should I make 3 different div or, it is possible in some other way?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda